package com.sgcc.lms.openstack.service;

import com.sgcc.lms.openstack.exception.*;
import org.openstack4j.model.common.ActionResponse;
import org.openstack4j.model.storage.block.Volume;
import org.openstack4j.model.storage.block.VolumeType;

import java.io.IOException;
import java.util.List;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-07-22 17:18
 * @Description:
 */
public interface CinderService {

    /**
     * @Author 李孟帅
     * @Description 列出卷类型
     * @Date 2020/7/22
     **/
    List<? extends VolumeType> volumeTypes(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 列出当前项目有权访问的卷
     * @Date 2020/7/22
     **/
    List<? extends Volume> volumes(String tokenId) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 获取卷
     * @Date 2020/7/22
     **/
    Volume getVolume(String tokenId,String id) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 创建卷
     * @Date 2020/7/22
     **/
    Volume createVolume(String tokenId,Volume volume) throws NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 更新卷
     * @Date 2020/7/22
     **/
    String updateVolume(String tokenId,Volume volume) throws HttpException, IOException, NullTokenException;

    /**
     * @Author 李孟帅
     * @Description 删除卷
     * @Date 2020/7/22
     **/
    ActionResponse deleteVolume(String tokenId, String id) throws NullTokenException;
}
